<% function NrTel(nr) if len(nr) > 2 then n=3 if len(nr) mod 2 = 0 then n =2 fiRsNotkat= left(nr,n) for i = 0 to (len(nr)-n)/2 -1 NrTel=NrTel & " " & mid(nr,n+1+i*2,2) next NrTel=fiRsNotkat + NrTel else NrTel=nr end if end function Set Conn = Server.CreateObject("ADODB.Connection") Conn.Open Application("firma_ConnectionString") sqlWhere="" sql="SELECT DISTINCT Firma_Serwis_KlubCHIP.Nazwa, Firma.ID, Firma.Miejscowosc, PrzedrostekAdresu+' '+Adres+' 'AS Adres, NrDomu, NrLokalu, KodPocztowy+' '+Miejscowosc AS Poczta, Firma_Serwis_KlubCHIP.AdresEmail AS AdresEmailKlub, Firma_Serwis_KlubCHIP.Telefon AS TelefonKlub, Firma.AdresEmail, Firma.AdresURL,Firma_Serwis_KlubCHIP.Dzialalnosc, Firma_Serwis_KlubCHIP.P41Rabat, Firma_Serwis_KlubCHIP.P42Rabat, Firma_Serwis_KlubCHIP.P43Rabat, Firma_Serwis_KlubCHIP.P4aTekst, Firma_Serwis_KlubCHIP.P4aRabat, Firma_Serwis_KlubCHIP.P4bTekst, Firma_Serwis_KlubCHIP.P4bRabat, Firma_Serwis_KlubCHIP.P4cTekst, Firma_Serwis_KlubCHIP.P4cRabat, Firma_Serwis_KlubCHIP.P4dTekst, Firma_Serwis_KlubCHIP.P4dRabat, Firma_Serwis_KlubCHIP.P4eTekst, Firma_Serwis_KlubCHIP.P4eRabat, Firma_Serwis_KlubCHIP.P4fTekst, Firma_Serwis_KlubCHIP.P4fRabat,Firma_telefon_rodzaj.Skrot AS Opis, Firma_telefon.NrKierunkowy, Firma_telefon.NrTelefonu, Firma_telefon.NrWew " sqlFrom=" FROM (Firma_Serwis_KlubCHIP INNER JOIN Firma ON Firma_Serwis_KlubCHIP.FirmaID = Firma.ID) LEFT OUTER JOIN (Firma_telefon INNER JOIN Firma_Telefon_Rodzaj ON Firma_telefon.RodzajID = Firma_Telefon_Rodzaj.ID) ON Firma_telefon.FirmaId = Firma.ID " if request("miejscowosc")<>"" then sqlWhere=" WHERE Firma.Miejscowosc='"&request("miejscowosc")&"'" 'response.write sql&sqlFrom&sqlWhere Set firmy = Conn.execute(sql&sqlFrom&sqlWhere) OldId="" Set fs = CreateObject("Scripting.FileSystemObject") 'dla odczytywania logów while not firmy.eof OldID=firmy("ID") AdresEmail=firmy("AdresEmail") if firmy("AdresEmailKlub")<>"" then AdresEmail=firmy("AdresEmailKlub") Telefon="" if firmy("TelefonKlub") <>"" then Telefon=firmy("TelefonKlub") AdresURL="" if firmy("AdresURL") <> "" then AdresURL=firmy("AdresURL") P41Rabat=firmy("P41Rabat") P42Rabat=firmy("P42Rabat") P43Rabat=firmy("P43Rabat") P4aRabat=firmy("P4aRabat") P4bRabat=firmy("P4bRabat") P4cRabat=firmy("P4cRabat") P4dRabat=firmy("P4dRabat") P4eRabat=firmy("P4eRabat") P4fRabat=firmy("P4fRabat") P4aTekst=firmy("P4aTekst") P4bTekst=firmy("P4bTekst") P4cTekst=firmy("P4cTekst") P4dTekst=firmy("P4dTekst") P4eTekst=firmy("P4eTekst") P4fTekst=firmy("P4fTekst") bPromocja=true' UWAGA wylaczona na zasze promocja if firmy("Dzialalnosc")="x" then bPromocja=false %> <% if not firmy.eof then if OldID=firmy("ID") then firmy.MoveNext end if wend Conn.close %>
<%'=OldID&"
"%> <% path="d:\inetpub\chiproot\klubserwisroot\listafirm\loga\" logo="" if fs.FileExists(Path&OldID&".gif") then logo = OldID&".gif" end if if fs.FileExists(Path&OldID&".jpg") then logo = OldID&".jpg" end if if logo<>"" then ImageStr="" if AdresURL<>"" then ImageStr =""&ImageStr&"" response.write ImageStr end if%>
<%=firmy("nazwa")%>
<% if InStr(firmy("adres"),"_")=0 then Nrlokalu=firmy("NrDomu") if firmy("Nrlokalu")<>"" then Nrlokalu=Nrlokalu&"/"&firmy("Nrlokalu") response.write firmy("adres") & NrLokalu&"
"& firmy("poczta") end if %>
<% OpisOld=" " do while not firmy.Eof and OpisOld<>"" and (OldID=firmy("ID")) sNrKier="" sNrTel="" NrKierunkowyOld="" if firmy("NrKierunkowy") <> "" then sNrKier= " (0-" & firmy("NrKierunkowy") & ") " NrKierunkowyOld=firmy("NrKierunkowy") end if OpisOld = firmy("Opis") i=1 do while OpisOld = firmy("Opis") and not firmy.Eof and (OldID=firmy("ID")) if i > 1 then sNrTel = sNrTel & ", " if NrKierunkowyOld<>firmy("NrKierunkowy") then sNrTel=sNrTel&" (0-" & firmy("NrKierunkowy") & ") " NrKierunkowyOld=firmy("NrKierunkowy") end if sNrTel = sNrTel & NrTel(firmy("NrTelefonu")) if firmy("NrWew") <> "" then sNrTel= sNrTel & " wew. "& firmy("NrWew") OpisOld=firmy("Opis") firmy.MoveNext i=i+1 if firmy.Eof then exit do loop if OpisOld<>"" and Telefon="" then response.write OpisOld & ": " & sNrKier & sNrTel & "
" if firmy.Eof then exit do loop if Telefon<>"" then response.write Telefon&"
" %> <%if AdresEmail<>"" then%> <%=AdresEmail%>
<%end if%> <%if AdresURL<>"" then%> <%=AdresURL%>
<%end if%>
oferta:
<%if P41Rabat<>"" then%>              <%if P41Rabat<>"" then response.write P41Rabat*100&"% "%>wszystkie produkty i usługi
<%end if%> <%if P42Rabat<>"" then%>              <%if P42Rabat<>"" then response.write P42Rabat*100&"% "%>wszystkie usługi
<%end if%> <%if P43Rabat<>"" then%>              <%if P43Rabat<>"" then response.write P43Rabat*100&"% "%>wszystkie produkty
<%end if%> <%if P4aTekst<>"" then%>              <%if P4aRabat<>"" then response.write P4aRabat*100&"% "%><%=P4aTekst%>
<%end if%> <%if P4bTekst<>"" then%>              <%if P4bRabat<>"" then response.write P4bRabat*100&"% "%><%=P4bTekst%>
<%end if%> <%if P4cTekst<>"" then%>              <%if P4cRabat<>"" then response.write P4cRabat*100&"% "%><%=P4cTekst%>
<%end if%> <%if P4dTekst<>"" then%>              <%if P4dRabat<>"" then response.write P4dRabat*100&"% "%><%=P4dTekst%>
<%end if%> <%if P4eTekst<>"" then%>              <%if P4eRabat<>"" then response.write P4eRabat*100&"% "%><%=P4eTekst%>
<%end if%> <%if P4fTekst<>"" then%>              <%if P4fRabat<>"" then response.write P4fRabat*100&"% "%><%=P4fTekst%>
<%end if%>
<%if bPromocja then %><%end if %>